package com.surveillance.entities;

import java.util.ArrayList;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Column;;

@Entity
@Table(name = "AffectedStudent", uniqueConstraints = { @UniqueConstraint(columnNames = { "id" }) })
public class ArchiveAffectedStudents extends BaseEntity {// pour l'archivage 
	@Column(name="DATE_AFFECTATION")
	private Date dateAffectation;
	@OneToMany(fetch = FetchType.EAGER, targetEntity = Etudiant.class)
	private ArrayList<Etudiant> etudiant= new ArrayList<Etudiant>(); 
	@OneToMany(fetch = FetchType.EAGER, targetEntity = Salle.class)
	private ArrayList<Salle> salle= new ArrayList<Salle>() ;// one salle for a set of students
	
	public ArchiveAffectedStudents(){
		
	}
	
	public Date getDateAffectation() {
		return dateAffectation;
	}
	public void setDateAffectation(Date dateAffectation) {
		this.dateAffectation = dateAffectation;
	}
	public ArrayList<Etudiant> getEtudiant() {
		return etudiant;
	}
	public void setEtudiant(ArrayList<Etudiant> etudiant) {
		this.etudiant = etudiant;
	}

	public ArrayList<Salle> getSalle() {
		return salle;
	}

	public void setSalle(ArrayList<Salle> salle) {
		this.salle = salle;
	}

}
